package com.example.leepong.Helpers;

import android.graphics.Rect;
import android.graphics.RectF;

import com.example.leepong.Game.Shapes.FixedRectangle;
import com.example.leepong.Game.Shapes.Rectangle;

/**
 * Created by Ichigo on 27/02/14.
 */
public class ShapesHelpers
{
    public static Rect Round(RectF rect)
    {
        Rect rec = new Rect();
        rect.round(rec);
        return rec;
    }

    public static RectF ToRectF(FixedRectangle rect)
    {
        return new RectF(rect.Left, rect.Top, rect.Right, rect.Bottom);
    }

    public static RectF ToRectF(Rectangle rect)
    {
        return new RectF(rect.Left(), rect.Top(), rect.Right(), rect.Bottom());
    }

    public static Rect ToRect(Rectangle rect)
    {
        return new Rect((int)rect.Left(), (int)rect.Top(), (int)rect.Right(), (int)rect.Bottom());
    }

    public static Rect ToRect(FixedRectangle rect)
    {
        return new Rect((int)rect.Left, (int)rect.Top, (int)rect.Right, (int)rect.Bottom);
    }
}